package com.hliushi.chain.example01_wrong;

/**
 * 财务经理类 (5000元审批权限)
 *
 * @author: hliushi
 * @date: 2023/2/16 21:58
 **/
public class Manger {

    private final int MAX_AMOUNT = 5000;
    private String name;


    public Manger(String name) {
        this.name = name;
    }

    public boolean approve(int amount) {
        if (amount <= MAX_AMOUNT) {
            System.out.printf("审批通过。【经理: %s】\n", name);
            return true;
        } else {
            System.out.printf("无权审批，请找上级。【经理: %s】\n", name);
            return false;
        }
    }
}
